import '@/assets/saas/modules/_loaing.scss'
// import color from 'vuetify/lib/util/colorUtils'
import {VProgressCircular} from 'vuetify/lib';

export default {
    name: 'mu-loading',
    props: {
        size: Number,
        overlayColor: String,
        text: String,
        fixed: Boolean,
        className: String,
        color: String
    },
    data () {
        return {
            show: false
        };
    },
    render (h) {
        return h('div', {
            staticClass: 'v-loading'
        },[
            h('div', {
                staticClass: 'mu-loading-wrap',
                class: {
                    [this.className || '']: true,
                    'mu-loading-wrap__fixed': this.fixed
                },
                style: {
                    'background-color': this.overlayColor
                },
                directives: [{
                    name: 'show',
                    value: this.show
                }]
            }, [
                h(VProgressCircular, {
                    staticClass: 'mu-loading-circular',
                    props: {
                        indeterminate: true,
                        size: this.size,
                        width: 3,
                        color: this.color
                    }
                }),
                this.text ? h('span', {
                    staticClass: `mu-loading-text ${this.getNormalColorClass(this.color, true)}`,
                    style: {
                        color: this.color
                    }
                }, this.text) : undefined
            ])
        ]);
    }
};